package com.XinYun.Library.modules.borrow.Dao;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface borrowDao {
     void security(String sql) throws SQLException;
     ResultSet select(String Sql, Object obj) throws SQLException, IOException;
     int update(String Sql, Object obj) throws SQLException, IOException;
     String day(String endtime);

     static List convertList(ResultSet rs) throws Exception {
          List list = new ArrayList();
          ResultSetMetaData md = rs.getMetaData();//获取键名
          int columnCount = md.getColumnCount();//获取行的数量
          while (rs.next()) {
               Map rowData = new HashMap();//声明Map
               for (int i = 1; i <= columnCount; i++) {
                    rowData.put(md.getColumnName(i), rs.getObject(i));//获取键名及值
               }
               list.add(rowData);
          }
          return list;
     }
}
